package doorwifi.wd.patientsation.peripheral.mainapp.Adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

import doorwifi.wd.patientsation.peripheral.mainapp.R;

/**
 * Created by xuhuan on 2017/7/11.
 */

public class CallSiteIsTelInfoAdapter extends BaseAdapter {

    private Context mcontext;
    private String department;

    public CallSiteIsTelInfoAdapter(Context mcontext, String department) {
        this.mcontext = mcontext;
        this.department = department;
    }

    @Override
    public int getCount() {
        return 1;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Holder holder;
        if(convertView == null){
            convertView = View.inflate(mcontext,R.layout.xh_call_site_is_tel_info_layout,null);
            holder = new Holder();
            x.view().inject(holder,convertView);//注解绑定
            convertView.setTag(holder);
        }else {
            holder= (Holder) convertView.getTag();
        }
        holder.call_department.setText(department);

        return convertView;
    }

    private class Holder{
        @ViewInject(R.id.call_department)
        private TextView call_department;
    }
}
